﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core
{
    public static partial class msg
    {
        public static dynamic getNotice(int nid)
        {
            var sql = new Sql.SqlDataContext();
            var n = sql.Notice.FirstOrDefault(row => row.nid == nid);
            if (n == null) return new
                {
                    success = false,
                    msg = "公告不存在"
                };
            return new
            {
                success = true,
                n.nid,
                n.title,
                n.color,
                time = n.time.toTimeString(),
                n.content
            };
        }
    }
}